package UCM;

import Source.DisplayFlights;
import Views.ViewDisplayFlights;
import javax.swing.JPanel;

/**
 * Use case for Display flights
 * @author Jason Sorbello
 */
public class UCDisplayFlights implements UCController {

    private ViewDisplayFlights view;
    private DisplayFlights model = new DisplayFlights();

    /**
     * Initualises the view
     * @param view
     */
    public UCDisplayFlights(ViewDisplayFlights view) {
        this.view = view;
    }

    /**
     * Precondition: user is on main ui
     * user clicks on display flights button
     * system gets flight data
     * system displays flights
     * Postcondition: flights are displayed
     */
    public void run() {
        JPanel temp = model.getData();
        view.setDisplayFlightsVisible(temp);
    }
}
